#ifndef _ESP8266_H_
#define _ESP8266_H_




typedef enum{
    STA,
    AP,
    STA_AP
}ENUM_Net_ModeTypeDef;

typedef enum{
    enumTCP,
    enumUDP,    
}ENUM_Net_ModeTypeDef;

typedef enum{
    Multiple_ID_0 = 0,
    Multiple_ID_1 = 1,
    Multiple_ID_2 = 2,
    Multiple_ID_3 = 3,
    Multiple_ID_4 = 4,
    Single_ID_0 = 5,
}ENUM_ID_NO_TypeDef;

typedef enum{
    OPEN = 0,
    WEP = 1,
    WPA_PSK = 2,
    WPA2_PSK = 3,
    WPA_WPA2_PSK =4,
}ENUM_AP_PsdMode_TypeDef;

#define RX_BUF_MAX_LEN          1024

struct STRUCT_USARTx_Fram
{
    char Data_RX_BUF[RX_BUF_MAX_LEN];

    union {
        __IO u16 InfAll;
        struct {
            __IO u16 FramLength     :15;        // 14:0
            __IO u16 FramFinishFlag :1;         // 15
        }InfBit;
    };
}strESP8266_Fram_Record;



#define ESP8266_CH_PD_CLK       RCC_APB2Periph_GPIOG
#define ESP8266_CH_PD_PORT      GPIOG
#define ESP8266_CH_PD_PIN       GPIO_Pin_13

#define ESP8266_RST_CLK         RCC_APB2Periph_GPIOG
#define ESP8266_RST_PORT        GPIOG
#define ESP8266_RST_PIN         GPIO_Pin_14

#define ESP8266_USARTx          USART3
#define ESP8266_USART_CLK       RCC_APB1Periph_USART3
#define ESP8266_USART_GPIO_CLK  RCC_APB2Periph_GPIOB
#define ESP8266_USART_TX_PORT   GPIOB
#define ESP8266_USART_TX_PIN    GPIO_Pin_10
#define ESP8266_USART_RX_PORT   GPIOB
#define ESP8266_USART_RX_PIN    GPIO_Pin_11
#define ESP8266_USART_IRQ       USART3_IRQn     

#define ESP8266_USART(fmt, ...)     USART_printf(ESP8266_USARTx)



#endif


